package test;

import java.util.concurrent.*;

public class demo7 {
    //使用ThreadPoolExecutor创建一个忽略最新任务的线程池
    ExecutorService pool = new ThreadPoolExecutor(5, 10,
            1000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(100),
            Executors.defaultThreadFactory(),new ThreadPoolExecutor.DiscardPolicy());
}
